# This file is part of chimaira-server.
# For copyright information, see AUTHORS.
#
# server-server is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# chimaira-server is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with chimaira-server.  If not, see <http://www.gnu.org/licenses/>.

# autoconf
AC_INIT([chimaira-server], [0.2],[http://code.google.com/p/chimaira/issues],[chimaira-server],[http://code.google.com/p/chimaira/])
AC_PREREQ(2.64)
AC_CONFIG_SRCDIR(src/chimaira.vala)
AC_CONFIG_HEADERS([config.h:config.h.in])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/valac.m4])
AC_PROG_LIBTOOL

# automake
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE

# set prefix
AC_PREFIX_DEFAULT([/usr])

# check for programs
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AM_PROG_CC_C_O

LT_PREREQ([2.2.6])
LT_INIT

AM_PROG_VALAC([0.12.0])
AM_PROG_CHECK_VALAC_VERSION([0.16])
AC_SUBST(VALAC_VERSION_FLAG)

GTK_MODULE=gtk+-3.0
GEE=gee-1.0
SQLITE3=sqlite3

GDK_REQS=3.0.8
GEE_REQS=0.5.0
SQLITE3_REQS=3.6.0

PKG_CHECK_MODULES(SERVER,
                  $GTK_MODULE >= $GDK_REQS
                  $GEE >= $GEE_REQS
                  $SQLITE3 >= $SQLITE3_REQS)
AC_SUBST(SERVER_CFLAGS)
AC_SUBST(SERVER_LIBS)

autostart=true
AC_ARG_ENABLE(autostart,
    [  --disable-autostart     Disable server autostart],
    [autostart=false])
AM_CONDITIONAL(AUTOSTART, test x$autostart = xtrue)

# output files
AC_CONFIG_FILES([Makefile
                 data/Makefile
                 src/Makefile])
AC_OUTPUT
